 <if condition="empty($cartList)"> 
	<div class="no-cart k-row">		
			<span><i class="fa fa-shopping-cart"></i>购物车是空的，快去<a href="__ROOT__/">购物吧</a></span>		
	</div>
     
<else /> 

<div class="cart-pro-list k-row">
	<table width="100%" border="0" cellspacing="0" cellpadding="1">
		<tr class="ca-tt">
			<th width=50></th>
			<th align="center" valign="middle" colspan="2" width=500>商品</th>
			<th align="center" valign="middle" width=150>单价</th>
			<th align="center" valign="middle" width=150>数量</th>
			<th align="center" valign="middle" width=150>小计</th>
			<th align="center" valign="middle" width=150>操作</th>
		</tr>
		<foreach name="cartList" item="v" key="k" >
      <tr class="ca-ss">
        <td class="pa-le-9" align="center" valign="middle">    
            <input type="checkbox" class="check-js" name="cart_select[{$v.id}]" <if condition="$v[selected] eq 1" >checked="checked"</if> value="1" onclick="ajax_cart_list();" />
        </td>
        <td width="80px" align="center" valign="middle">
            <a class="" href="{:leuu('article/index',array('id'=>$v['goods_cat_id'],'g_id'=>$v['goods_id']))}">
                <img class="wi63 hi63" src="{$v.goods_id|goods_thumb_images=80,80}">
            </a>
        </td>
        <td class="wi516" align="left" valign="middle">
            <p>
            	<a href="{:leuu('article/index',array('id'=>$v['goods_cat_id'],'g_id'=>$v['goods_id']))}" style="vertical-align:middle">{$v.goods_name}</a>                          
            </p>
            <p>{$v.spec_item_name}</p>
        </td>
                               
        <td align="center" valign="middle"><span>￥{$v.goods_price}</span></td>
                
        <td align="center" valign="middle">           
			<div class="j-num cart-num">
				<div class="selnum">
					<span class="j-reduce" onClick="switch_num(-1,{$v.id},{$v.store_count});"><i class="fa fa-minus"></i></span>
					<input class="j-input" type="text" value="{$v.goods_num}" name="goods_num[{$v.id}]" id="goods_num[{$v.id}]" readonly />
					<span class="j-add" onClick="switch_num(1,{$v.id},{$v.store_count});"><i class="fa fa-plus"></i></span>
				</div>							
			</div>
        </td>
        <td align="center" valign="middle">￥{$v.goods_fee}</td>
        <td align="center" valign="middle"><a  class="gwc-gb" href="javascript:void(0);" onclick="ajax_del_cart({$v.id});"><i class="fa fa-times"></i></a></td>
      </tr>
    </foreach> 
	<input type="hidden" value="{$check_num}" id="check_num" />
	</table>
	
	<div class="sc-total-list">		
			<div class="t-cart-cb fl">
				<input type="checkbox" name="select_all" id="select_all" <if condition="$select_all eq 1" >checked="checked"</if> onchange="check_all();" value="1"/>
				<label for="select_all" style="margin-right:15px;">全选</label>
				<a href="javascript:void(0);" onclick="layerPrompt();">删除选中商品</a>				
			</div>
			<div class="g-acti-list fr">            	
                <a class="gwc-qjs <if condition="$total_price['total_fee'] eq 0">ng-buy</if>" href="javascript:;" <if condition="$total_price['total_fee'] neq 0">onClick="layerLogin()"</if> >去结算</a>
            </div>
			<div class="t-price fr">
				<span class="t-fee">商品总计：￥{$total_price.total_fee}</span>
				<span class="t-l-pri">应付金额：<em>￥{$total_price.cut_fee}</em></span>
			</div>						
	</div>
</div>

<script type="text/javascript">
	var is_check = $('input.check-js:checked').length;	
	var check_num = $('#check_num').val();
	if(check_num == is_check){
		$('#select_all').attr('checked',true);
	}else{
		$('#select_all').attr('checked',false);
	}
</script>
<script type="text/javascript">
	function layerPrompt(){
		if($("input[type='checkbox']").is(':checked')==false){			
			layer.msg('请选择商品');
			return false;
		}
		layer.confirm('确定要删除吗？', {
		  btn: ['确定','取消'] //按钮
		}, function(){
			del_cart_all();
			layer.msg(null);
		}, function(){
		  
		});
	}
</script>
<script type="text/javascript">
	function layerLogin(){
		$.post("{:U('user/index/is_login')}",{},function(data){
			if(data.status==1){		
				layer.closeAll();
				window.location.href="{:U('Goods/Cart/cart_buy',array('to_buy'=>'cart'))}";			
			}
			if(data.status==0){
				var _html = "{:U('User/login/layerlogin')}";		
				layer.open({
				type: 2,
				title: '登录',
				shadeClose: true,
				shade: 0.8,
				area: ['385px', '460px'],
				content: _html,
				});	
			}				
		});	
		 
	}	
</script>
</if>
